package com.itheima;
import java.util.ArrayList;
import java.util.LinkedList;

/**
 * @ProjectName: ybxy6
 * @Titile: LinkedListDemo
 * @Author: Muelsyse
 * @Description: TODO
 */
public class LinkedListDemo {
    // 主方法
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<String>();
        list.addFirst("张三");
        list.addLast("李四");
        list.addLast("尤五");
        list.addLast("熊六");
        list.addLast("杨八");

        String s = list.get(0);
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("张三");
        arrayList.get(0);

    String first = list.getFirst();
    System.out.println(first);

    String last = list.getLast();
    System.out.println(last);

    String removeFirst = list.removeFirst();
    System.out.println(removeFirst);

    String removeLast = list.removeLast();
    System.out.println(removeLast);

    System.out.println(list);

    }

}

